Skip to content

Conversation

StaszekM
Copy link

@StaszekM StaszekM commented Sep 5, 2025

Introduces --no-hydra in the CLI of dvc exp run, which disables automatically inserting Hydra config into params.yaml.

Fixes #10863

Thank you for the contribution - we'll try to review it as soon as possible. πŸ™

Introduces --no-hydra in the CLI of dvc exp run, which disables automatically inserting Hydra config into params.yaml.

Fixes iterative#10863
Copy link

codecov bot commented Sep 5, 2025

Codecov Report

βœ… All modified and coverable lines are covered by tests.
βœ… Project coverage is 91.12%. Comparing base (2431ec6) to head (e4897b6).
⚠️ Report is 128 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #10866      +/-   ##
==========================================
+ Coverage   90.68%   91.12%   +0.43%     
==========================================
  Files         504      504              
  Lines       39795    40794     +999     
  Branches     3141     3239      +98     
==========================================
+ Hits        36087    37172    +1085     
+ Misses       3042     2982      -60     
+ Partials      666      640      -26     

β˜” View full report in Codecov by Sentry.
πŸ“’ Have feedback on the report? Share it here.

πŸš€ New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment on lines +190 to +196
@pytest.mark.parametrize("no_hydra", [True, False])
def test_mixing_no_hydra_and_sweeps(
tmp_dir, params_repo, dvc, mocker, hydra_enabled, overrides, expected, no_hydra
):
# Passing no_hydra should not prevent user from
# queuing sweeps with --set-param and --queue
patched = mocker.patch.object(dvc.experiments, "queue_one")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the point of using --no-hydra here?

Would this still hydrate yaml file using hydra? Or, is this only limited to sweeps?

Copy link
Author

@StaszekM StaszekM Sep 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

During first tests (dvc exp run) no-hydra flag worked fine, but I noticed later that this flag does not work if we pass --queue and related sweep params, then sweeps are created with configs hydrated with Hydra.

So I changed implementation in both exp scenarios (as one exp and as a sweep) to handle this new flag

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You may also need to change this:

def _update_params(self, params: dict[str, list[str]]):

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@skshetry Hey sorry for the delay, the _update_params function you mentioned should now have extra no_hydra flag that bypasses entire composing process and goes straight to ordinary overrides application

@StaszekM StaszekM requested a review from skshetry September 6, 2025 11:45
@skshetry skshetry moved this from Backlog to Review In Progress in DVC Oct 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Review In Progress

Development

Successfully merging this pull request may close these issues.

dvc exp run - CLI flag that bypasses automatic Hydra composition

2 participants